pub async fn peer_start() -> anyhow::Result<()> {
    let peer_config = model_graph_common::config::get_peer_config().await?;
    tracing::info!("节点启动:{}", peer_config.peer_id);
    let _ = set_peer_id(&peer_config.peer_id)?;

    Ok(())
}

pub async fn peer_login(token: &String) -> anyhow::Result<()> {
    //
    let _ = set_token(token)?;
    //连接g01信令服务
    let token_1 = token.clone();
    // let _ = crate::signaling::connect_g01_signaling(&token_1).await;

    // tokio::spawn(async move {
    //     loop {
    //         let token_temp = token_1.clone();

    //         if let Ok(login) = signaling_is_login() {
    //             if !login {
    //                 tracing::info!("进行连接信令服务.....");
    //                 let _ = crate::signaling::connect_g01_signaling(&token_temp).await;
    //             } else {
    //                 if let Err(err) = request_family().await {
    //                     //
    //                     tracing::error!("发送rrai,失败:{}", err);
    //                 }
    //             }
    //         }
    //         tracing::info!("休眠以再度检测");
    //         tokio::time::sleep(tokio::time::Duration::from_secs(20)).await;
    //     }
    // });

    Ok(())
}

use model_graph_channel::pubsub::set_on_message_callback;
use model_graph_types::peer::{set_peer_id, set_token};

pub use crate::monitor::status::peer_status;
use crate::{
    net::net_live,
    signaling::{request_family, signaling_is_login},
};
